//导入 mongoose
const mongoose = require('mongoose');

//创建结构对象
let BookSchema = new mongoose.Schema({
  author: String,
  price: Number,
  title: String,
});

//创建文档模型对象           集合名称   结构对象
let BookModel = mongoose.model("book", BookSchema); // 集合名称最终会转为复数, 称为

//暴露模型对象
module.exports = BookModel;
